#ifndef __RINGQUEUE_H_
#define __RINGQUEUE_H_
#include "stm32f4xx_hal.h"
#include "cJSON.h"
//数组长度
#define Array_Len   128



/*环形队列数据类型定义*/
typedef struct ring_buff
{
    int32_t read_pointer;
    int32_t write_pointer;
    uint8_t data[Array_Len];
}* volatile ringQueue_t;




extern volatile char used_data[Array_Len];
extern volatile char ringBuff_flag;

ringQueue_t fifo_init(void);
uint8_t get_ringbuff_fullstate(ringQueue_t p_ring_buff);
uint8_t get_ringbuff_emptystate(ringQueue_t p_ring_buff);
uint8_t ring_buff_insert(ringQueue_t p_ring_buff,uint8_t data);
uint8_t ring_buff_oneGet(ringQueue_t p_ring_buff);
char* get_dataFrame(ringQueue_t p_ring_buff,uint32_t num);
uint8_t ring_buff_destory(ringQueue_t p_ring_buff);
void get_usedData(ringQueue_t p_ring_buff);
int8_t use_dataFrame(char* buff,char* temp,...);
#endif